﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Furion.CMS.Core.Base
{
    /// <summary>
    /// 排序模式
    /// </summary>
    public enum SortMode
    {
        /// <summary>
        /// 正序
        /// </summary>
        Ascend,
        /// <summary>
        /// 倒序
        /// </summary>
        Descend
    }

    /// <summary>
    /// 排序信息
    /// </summary>
    public class SortInfo
    {
        /// <summary>
        /// 字段
        /// </summary>
        public string Field { get; set; }
        /// <summary>
        /// 模式
        /// <para>
        /// asc | desc
        /// </para>
        /// </summary>
        public SortMode Mode { get; set; }
        /// <summary>
        /// 追加排序字段
        /// </summary>
        public string ThenSortField { get; set; }
        /// <summary>
        /// 追加排序模式
        /// </summary>
        public SortMode ThenSortMode { get; set; }

    }

    /// <summary>
    /// 排序参数
    /// </summary>
    public abstract class BaseSortParams
    {
        /// <summary>
        /// 获取排序
        /// </summary>
        /// <returns></returns>
        public abstract SortInfo GetSort();
    }
}
